<?php
/**
 * Bootstrap.
 *
 * @category PhpCilux
 * @package  PhpCilux
 */

/**
 * Bootstrap.
 *
 * @package PhpCilux
 */

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

    /**
     * Init the autoloader.
     *
     * @return Zend_Application_Module_Autoloader
     */
    protected function _initAutoload()
    {
        $autoloader = new Zend_Application_Module_Autoloader(array(
          'basePath'      => APPLICATION_PATH,
          'namespace'     => '',
        ));

        return $autoloader;
    }

    /**
     * Init view settings.
     *
     * @return Zend_View
     */
    protected function _initView()
    {
        // Initialize view.
        $view = new Zend_View();

        $view->serverurl = 'http://' . $_SERVER['SERVER_NAME'];
        $view->version   = 'v0.2.0';

        $view->doctype('XHTML1_STRICT');
        $view->headTitle('phpcilux - continuous integration monitoring ');

        $view->HeadLink(
            array(
                'rel' => 'shortcut icon',
                'href' => 'favicon.ico'
            )
        );
        $view->HeadLink(
            array(
                'rel'  => 'stylesheet',
                'type' => 'text/css',
                'href' => 'skin/reset.css'
            )
        );
        $view->HeadLink(
            array(
                'rel'  => 'stylesheet',
                'type' => 'text/css',
                'href' => 'skin/main.css'
            )
        );

        $view->setEncoding('utf-8');
        $view->HeadMeta('text/html; charset=utf-8', 'content-type', 'http-equiv');

        // Add it to the ViewRenderer.
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
            'ViewRenderer'
        );
        $viewRenderer->setView($view);

        // Return it, so that it can be stored by the bootstrap.
        return $view;
    }

}